package com.atguigu.gmall.order.pay.config;


import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PayConfig {


    @Bean
    public AlipayClient alipayClient(PayProperties payProperties){

      return   new DefaultAlipayClient(payProperties.getGatewayUrl(),
              payProperties.getApp_id(),
              payProperties.getMerchant_private_key(),
              "json", payProperties.getCharset(),
              payProperties.getAlipay_public_key(),
              payProperties.getSign_type());
    }





}
